package com.lh.java.basic.clone;

import com.lh.log.log4j.LoggerImpl;
import com.lh.log.log4j.interfaces.Log;

public class TestObjectClone {
	private static Log logger = new LoggerImpl(TestObjectClone.class);

	/**
	 * @param args
	 * @Author: 李恒
	 */
	public static void main(String[] args) {
		
		
		MessageInfo mi=new MessageInfo();
		mi.setId(1);
		mi.setContent("i am is myself");
		MessageInfo tmi=null;
		try {
			tmi=(MessageInfo) mi.clone();
		} catch (CloneNotSupportedException e) {			
			e.printStackTrace();
		}
		if(null!=tmi){
			tmi.setContent("i am clone object");
			System.out.println("myself="+mi.getContent());
			System.out.println("clone="+tmi.getContent());
		}
	}

}
